// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import VueRouter from "vue-router";
import App from "./App.vue";
import routes from "./router/index.js";

import { Toast, Dialog } from "feui";

window.Toast = Toast;
window.Dialog = Dialog;

import "./assets/iconfont/iconfont.css";
import "./styles/index.less";

Vue.config.productionTip = false
Vue.use(VueRouter);

const router = new VueRouter({
  routes
});
window.vueRouter = router;
router.beforeEach((to, from, next) => {
  next();
});

router.afterEach((to, from) => {
  document.title = to.meta.title;
});
new Vue({
  el: "#app",
  render: h => h(App),
  router,
  data() {
    return {
      transitionName: "slide-right"
    };
  },
  watch: {
    $route(to, from) {
      this.transitionName =
        from.name === "index" ? "slide-left" : "slide-right";
    }
  }
});


